import { MockMethod } from "vite-plugin-mock"

export default [
  {
    url: "/dev-api/device/controlGateway/search",
    timeout: 2000,
    method: "post",
    response: () => {
      return {
        "code": 20000,
        "message": "获取数据成功",
        "data": {
          "total": "@integer(10, 50)", // 总记录数
          "records|10": [{ //生成20条数据
            "id|+1": 1, //初始值1开始，每条+1
            "devCode": '@ctitle',
            "devname": '@ctitle',
            "sysNum|1-5": /\d/,
            "devNum|1-5": /\d/,
            'status|10-2': true, // Boolean, 生成 true 概率 10/(10+2), false 概率 2/(10+2)
            "onlineStatus|10-2": true,
            "ip": /\d{3}\.\d{3}\.\d{1,3}\.\d{1,3}/,
            "devType": "@ctitle",
            "position": "A区_" + "@word(5)", // ROLE_5个英文字符
            "createTime": "@date", // 随机创建时间
            "updateTime": "@date", // 随机更新时间
          }]
        }
      }
    }
  },
] as MockMethod[]